package com.nuo.admin.base.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nuo.admin.base.entity.SysPermission;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nuo.admin.pojo.query.PermissionPageQuery;
import com.nuo.admin.pojo.vo.permission.PermissionPageVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author LGC
* @description 针对表【sys_permission(权限表)】的数据库操作Mapper
* @createDate 2022-02-09 11:35:10
* @Entity com.nuo.admin.base.entity.SysPermission
*/
@Mapper
public interface SysPermissionMapper extends BaseMapper<SysPermission> {
    /**
     * 获取权限分页列表
     *
     * @param page
     * @param queryParams
     * @return
     */
    List<PermissionPageVO> listPermissionsWithPage(Page<PermissionPageVO> page,@Param("queryParams") PermissionPageQuery queryParams);

    /**
     * 获取权限和拥有权限的角色映射
     *
     * @return
     */
    List<SysPermission> listPermRoles();

    /**
     * 根据角色编码集合获取按钮权限
     *
     * @param roles
     * @return
     */
    List<String> listBtnPermByRoles(@Param("roles") List<String> roles);
}




